package com.gxa.retail_admin.controller;

import com.gxa.common.vo.ResultVo;
import com.gxa.modules.service.OrdersService;
import io.swagger.annotations.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/operation/order")
@Api(value = "订单管理Test",tags = "订单管理接口API-刘辉")
public class OrdersController {
    @Autowired(required = false)
    private OrdersService ordersService;
    /**
     * 查询门店订单列表接口
     */
    @ApiOperation(value = "查询门店订单接口",notes = "门店订单信息",httpMethod = "GET", response = ResultVo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true),

    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code = 400,message = "参数接口错误"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @GetMapping("/orders")
    @RequiresPermissions("门店订单")
    @ResponseBody
    public ResultVo queryOrdersList(Integer currentPage,Integer pageSize){
         ResultVo resultVo=ordersService.queryOrdersList(currentPage,pageSize);
        return resultVo;
    }

    /**
     * 搜索门店订单接口
     */
    @ApiOperation(value = "搜索门店订单接口",notes = "搜索门店订单",httpMethod = "GET", response = ResultVo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "conn",value = "搜索条件",paramType = "query",dataType = "String",required = true),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code = 400,message = "参数接口错误"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @GetMapping("/searchByRequire")
    @RequiresPermissions("门店订单")
    @ResponseBody
    public ResultVo searchByOrders(Integer currentPage,Integer pageSize,String conn){
        ResultVo resultVo=ordersService.searchByOrders(currentPage,pageSize,conn);
        return resultVo;
    }

    /**
     * 查询待支付订单接口
     */
    @ApiOperation(value = "查询待支付订单接口",notes = "查询待支付订单",httpMethod = "GET", response = ResultVo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code = 400,message = "参数接口错误"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @GetMapping("/searchByStatus4")
    @RequiresPermissions("门店订单")
    @ResponseBody
     public ResultVo queryByOr_status4(Integer currentPage,Integer pageSize){
         ResultVo resultVo=ordersService.queryByOr_status4(currentPage,pageSize);
         return resultVo;
     }

    /**
     * 查询已支付订单接口
     */
    @ApiOperation(value = "查询已支付订单接口",notes = "查询已支付订单",httpMethod = "GET", response = ResultVo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code = 400,message = "参数接口错误"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @GetMapping("/searchByStatus1")
    @RequiresPermissions("门店订单")
    @ResponseBody
    public ResultVo queryByOr_status1(Integer currentPage,Integer pageSize){
        ResultVo resultVo=ordersService.queryByOr_status1(currentPage,pageSize);
        return resultVo;
    }

    /**
     * 查询售后订单
     */
    @ApiOperation(value = "查询售后订单接口",notes = "查询售后订单",httpMethod = "GET", response = ResultVo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code = 400,message = "参数接口错误"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @GetMapping("/searchByStatus23")
    @RequiresPermissions("门店订单")
    @ResponseBody
    public ResultVo queryByOr_status23(Integer currentPage,Integer pageSize){
        ResultVo resultVo=ordersService.queryByOr_status23(currentPage,pageSize);
        return resultVo;
    }

    /**
     * 门店售后
     */
    @ApiOperation(value = "门店售后接口",notes = "查询门店售后订单",httpMethod = "GET", response = ResultVo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code = 400,message = "参数接口错误"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @GetMapping("/query")
    @RequiresPermissions("门店订单")
    @ResponseBody
    public ResultVo ordersShouHou(Integer currentPage,Integer pageSize){
        ResultVo resultVo=ordersService.queryShouHou(currentPage,pageSize);
        return resultVo;
    }

    /**
     * 查询已退款订单
     */
    @ApiOperation(value = "查询已退款订单接口",notes = "查询已退款订单",httpMethod = "GET", response = ResultVo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code = 400,message = "参数接口错误"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @GetMapping("/queryRefund")
    @RequiresPermissions("门店订单")
    @ResponseBody
     public ResultVo queryReturnMoney(Integer currentPage,Integer pageSize){
         ResultVo resultVo=ordersService.queryRefund(currentPage,pageSize);
         return resultVo;
     }

    /**
     * 查询部分退款订单
     */
    @ApiOperation(value = "查询部分退款订单接口",notes = "查询部分退款订单",httpMethod = "GET", response = ResultVo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code = 400,message = "参数接口错误"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @GetMapping("/queryRest")
    @RequiresPermissions("门店订单")
    @ResponseBody
    public ResultVo queryRestMoney(Integer currentPage,Integer pageSize){
        ResultVo resultVo=ordersService.queryRestMoney(currentPage,pageSize);
        return resultVo;
    }
}
